<template>
  <div>
    <!-- v-show="布尔值"  true显示  false隐藏 
        v-if="布尔值"  true显示  false隐藏
    -->
    <h3>v-show和v-if</h3>
    <div class="box" v-show="flag">v-show控制</div>
    <div class="box1" v-if="flag">v-if控制</div>
    <button @click="flag=!flag">显示/隐藏</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      flag: true
    }
  }
}
</script>

<style>
.box{
  width: 200px;
  height: 200px;
  background: pink;
}
.box1{
  width: 200px;
  height: 200px;
  background:orange;
}
</style>